<?php

namespace app\common\listener;

class AppInit
{
    public function handle()
    {
        $lockFileName = root_path().'config/install.lock';
        if(!is_file($lockFileName)){
            $module = 'admin';
            $config = config('app.app_map',[]);
            if(!empty($config)&&$key = array_search($module,$config)){
                $module = $key;
            }
            if(request()->url()!='/yfcmf/install/index'){
                header("location: /{$module}/install/index");
                exit;
            }

        }
    }
}